import request from '../../utils/request';

/* 设备信息 */

    export function facilityInfoList (data) {
        return request({
        url: '/device-client/info',
        method: 'get',
        params:data
        })
    }
    /* 脚本执行 */
    export function facilityInfoStart (data) {
        return request({
        url: '/device-client/info/send-command',
        method: 'post',
        data
        })
    }

    /* 停止执行 */
    export function facilityInfoStop (data) {
        return request({
        url: '/device-client/info/cancel-command',
        method: 'post',
        data
        })
    }

    /* 设备新增 */
    export function facilityInfoAdd (data) {
        return request({
        url: '/device-client/info',
        method: 'POST',
        data
        })
    }

    /* 设备修改 */
    export function facilityInfoUpdate (data) {
        return request({
        url: '/device-client/info/'+data.id,
        method: 'PUT',
        data
        })
    }

    /* 设备删除 */
    export function facilityInfoDel (data) {
        return request({
        url: '/device-client/info/'+data.id,
        method: 'DELETE',
        })
    }
/**** 指令簇 ******/

    /* 列表 */
    export function directiveGroupList (data) {
        return request({
            url: '/device-client/instruction-cluster',
            method: 'get',
            params:data
        })
    }  
    
    /* 新增 */
    export function directiveGroupAdd (data) {
        return request({
            url: '/device-client/instruction-cluster',
            method: 'POST',
            data
        })
    }

    /* 编辑 */
    export function directiveGroupEdit (data) {
        return request({
            url: '/device-client/instruction-cluster/'+data.id,
            method: 'PUT',
            data
        })
    }

    /* 删除 */
    export function directiveGroupDel (data) {
        return request({
            url: '/device-client/instruction-cluster/'+data.id,
            method: 'DELETE',
        })
    }

/**** 指令簇 ******/

/* 列表 */
export function directiveList (data) {
    return request({
        url: '/device-client/instruction',
        method: 'get',
        params:data
    })
}  

/* 新增 */
export function directiveAdd (data) {
    return request({
        url: '/device-client/instruction',
        method: 'POST',
        data
    })
}

/* 编辑 */
export function directiveEdit (data) {
    return request({
        url: '/device-client/instruction/'+data.id,
        method: 'PUT',
        data
    })
}

/* 删除 */
export function directiveDel (data) {
    return request({
        url: '/device-client/instruction/'+data.id,
        method: 'DELETE',
    })
}

/**** 脚本 ******/

/* 列表 */
export function scriptList (data) {
    return request({
        url: '/device-client/task',
        method: 'get',
        params:data
    })
}  

/* 新增 */
export function scriptAdd (data) {
    return request({
        url: '/device-client/task',
        method: 'POST',
        data
    })
}

/* 编辑 */
export function scriptEdit (data) {
    return request({
        url: '/device-client/task/'+data.id,
        method: 'PUT',
        data
    })
}

/* 删除 */
export function scriptDel (data) {
    return request({
        url: '/device-client/task/'+data.id,
        method: 'DELETE',
    })
}
/* 脚本执行 */
export function scriptStart (data) {
    return request({
        url: '/device-client/info/send-command',
        method: 'POST',
        data
    })
}

/* 停止执行 */
export function scriptStop (data) {
    return request({
        url: '/device-client/info/cancel-command',
        method: 'POST',
        data
    })
}


